<?php
namespace app\easyreportphp\controller;
use app\easyreportphp\Model\MemberModule as MemberModuleModel;
use app\easyreportphp\Model\MetaCategory as MetaCategoryModel;
 
class Rest extends \think\controller\Rest
{
    public function home_getMenus()
    {
        switch ($this->method){
        case 'get': // get请求处理代码
          $result['success'] = true;
		  $result['msg'] = "ok";
		  $result['data'] = getMenus(); 
		  echo json_encode($result); 
            break;
        case 'put': // put请求处理代码
            break;
        case 'post': // post请求处理代码
            break;
        }
    }
	
	public function getCategoryTree()
    {  
		$result['success'] = true;
		$result['msg'] = "ok";
		$result['data'] = getMetaCategoryMenu();
		echo json_encode($result); 
	}
	
	public function getDataSource()
    {  
		$result['success'] = true;
		$result['msg'] = "ok";
		$result['data'] = getMetaDatasource();
		echo json_encode($result); 
	}
	public function getReportList()
    {  
		$result['success'] = true;
		$result['msg'] = "ok";
		$result['data'] = getMetaReport(1,50);
		echo json_encode($result); 
	}
}